package com.gongzhiyun.springboot3test.vo;

import lombok.Data;

import java.util.Random;


public class Epigram {

    private final static String epigram01 = "善良的行为使人的灵魂变得高尚";
    private final static String epigram02 = "一个有坚强心志的人，财产可以被人掠夺，勇气却不能被人剥夺";
    private final static String epigram03 = "一切真正的和伟大的东西，都是纯朴而谦逊的";
    private final static String epigram04 = "无人扶我青云志,我自踏雪至山巅";

    public static String getRandomEpigram() {
        Random random = new Random();
        int randomIndex;
        if (random.nextBoolean()) {
            return epigram04;
        }
        randomIndex = random.nextInt(3);
        return switch (randomIndex) {
            case 0 -> epigram01;
            case 1 -> epigram02;
            case 2 -> epigram03;
            default -> null;
        };
    }
}
